package com.stud.seckill.common.enums;

import lombok.Getter;

/**
 * 数据缓存KEY枚举
 */
@Getter
public enum CacheKeyEnum {

    用户("data:user:", "用户信息"),
    商品("data:goods:", "商品信息"),
    秒杀商品("data:killGoods:", "秒杀商品信息"),
    订单("data:order:", "订单信息"),
    秒杀订单("data:killOrder:", "秒杀订单信息"),

    秒杀监控数据("monitor:", "秒杀监控数据")
    ;

    private String key;

    private String description;

    private long timeout;

    CacheKeyEnum(String key, String description) {
        this.key = key;
        this.description = description;
        this.timeout = 60 * 30; // 30分
    }

    CacheKeyEnum(String key, String description, long timeout) {
        this.key = key;
        this.description = description;
        this.timeout = timeout;
    }

}
